package com.yy.crypto;

import com.yy.crypto.common.utils.IpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * @author yanglin
 * @description: 启动类
 * @email yling_dream@163.com
 * @date : Created in 2022/2/4 9:15
 */
@Slf4j
@SpringBootApplication
public class CryptoTestApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext application = SpringApplication.run(CryptoTestApplication.class, args);
        Environment env = application.getEnvironment();
        String ip = IpUtil.getLocalIp();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        log.info("\n----------------------------------------------------------\n\t" +
                "Application interface-crypto is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port + path + "\n\t" +
                "External: \thttp://" + ip + ":" + port + path + "\n\t" +
                "\n----------------------------------------------------------");
    }
}
